a=`date -d "1 day ago" '+%Y-%m-%d'`
{% for storage_path in salt['pillar.get']('app:papi:api_storage_path',[]) %}
/usr/bin/find {{ storage_path }}/logs/audit-trail-$a.txt -exec zip {{ storage_path }}/logs/backup-audit-trail-$a.zip {} \; -exec /bin/rm -f {} \;
/usr/bin/find {{ storage_path }}/logs/error-$a.txt -exec zip {{ storage_path }}/logs/backup-error-$a.zip {} \; -exec /bin/rm -f {} \;
/usr/bin/find {{ storage_path }}/logs/log-fpm-fcgi-$a.txt -exec zip {{ storage_path }}/logs/backup-log-fpm-fcgi-$a.zip {} \; -exec /bin/rm -f {} \;
/usr/bin/find {{ storage_path }}/logs/ -mtime +14 -exec /bin/rm -f {} \;
{% endfor %}
